import { Button } from 'antd';
import React from 'react';
import styles from './index.less';
interface PageInfoSearchProps {
  children?: React.ReactNode;
  addfn?: () => void;
  addprop?: string;
}

const PageInfoSearch: React.FC<PageInfoSearchProps> = props => {
  let { children, addprop, addfn } = props;
  return (
    <div className={styles.pageInfo}>
      {children ? <div>{children}</div> : <div></div>}
      {Boolean(addfn) ? (
        <Button onClick={addfn} className="btn_red">
          {addprop ?? '新增'}
        </Button>
      ) : (
        <div></div>
      )}
    </div>
  );
};

export default PageInfoSearch;
